package admin;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import shop.*;
import admin.*;

import com.opensymphony.xwork2.ActionSupport;
import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

import java.util.*;
import java.io.Reader;
import java.io.IOException;

import member.Memberbean;


public class AdminOrderDetailAction extends ActionSupport{

	public static Reader reader;
	public static SqlMapClient sqlMapper;
	
	private OrderBean result;
	private Memberbean member;
	private int ORDER_NUM;
	private String ORDER_M_ID;
	
	public AdminOrderDetailAction() throws IOException {
		reader = Resources.getResourceAsReader("sqlMapConfig.xml");
		sqlMapper = SqlMapClientBuilder.buildSqlMapClient(reader);
		reader.close();

	}
	
	public String execute() throws Exception {
		
		result = new OrderBean();
		result.setORDER_NUM(getORDER_NUM());
		
		result = (OrderBean)sqlMapper.queryForObject("infoOrderdmin",ORDER_NUM);
		member = (Memberbean)sqlMapper.queryForObject("getMember",result.getORDER_M_ID());
		
		return SUCCESS;
	}

	public OrderBean getResult() {
		return result;
	}
	public void setResult(OrderBean result) {
		this.result = result;
	}
	public int getORDER_NUM() {
		return ORDER_NUM;
	}
	public void setORDER_NUM(int ORDER_NUM) {
		this.ORDER_NUM = ORDER_NUM;
	}
	public Memberbean getMember() {
		return member;
	}
	public void setMember(Memberbean member) {
		this.member = member;
	}
	public String getORDER_M_ID() {
		return ORDER_M_ID;
	}
	public void setORDER_M_ID(String ORDER_M_ID) {
		this.ORDER_M_ID = ORDER_M_ID;
	}
}
